#include <bits/stdc++.h>
using namespace std;
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
using ll = long long;
class Solution
{
public:
    string removeDuplicates(string s)
    {
        stack<char> st;
        for (int i = 0; i < s.size(); i++)
        {
            if (st.empty())
                st.push(s[i]);
            else
            {
                if (st.top() == s[i])
                    st.pop();
                else
                    st.push(s[i]);
            }
        }
        string ans;
        while (!st.empty())
        {
            ans += st.top(), st.pop();
        }
        reverse(ans.begin(), ans.end());
        return ans;
    }
};
void solve()
{
    
}
int main()
{
    int t = 1;
    cin >> t;
    while(t--)
    {
        solve();
    }
   return 0;
}
